<template>
  <div class="right-box">
    <div class="top-box">
      <div class="pic-item" @click="$emit('preview-pic', pics[0].index)">
        <van-image lazy-load :src="pics[0].url">
          <template v-slot:loading>
            <img src="@/assets/goImages/8P.png" alt="" />
          </template>
        </van-image>
      </div>
      <div class="pic-item" @click="$emit('preview-pic', pics[1].index)">
        <van-image lazy-load :src="pics[1].url">
          <template v-slot:loading>
            <img src="@/assets/goImages/8P.png" alt="" />
          </template>
        </van-image>
      </div>
      <div class="pic-item" @click="$emit('preview-pic', pics[2].index)">
        <van-image lazy-load :src="pics[2].url">
          <template v-slot:loading>
            <img src="@/assets/goImages/8P.png" alt="" />
          </template>
        </van-image>
      </div>
    </div>
    <div class="bottom-box">
      <div class="left-item" @click="$emit('preview-pic', pics[3].index)">
        <van-image lazy-load :src="pics[3].url">
          <template v-slot:loading>
            <img src="@/assets/goImages/8P.png" alt="" />
          </template>
        </van-image>
      </div>
      <div class="right-item">
        <div class="pic-item" @click="$emit('preview-pic', pics[4].index)">
          <van-image lazy-load :src="pics[4].url">
            <template v-slot:loading>
              <img src="@/assets/goImages/8P.png" alt="" />
            </template>
          </van-image>
        </div>
        <div class="pic-item" @click="$emit('preview-pic', pics[5].index)">
          <van-image lazy-load :src="pics[5].url">
            <template v-slot:loading>
              <img src="@/assets/goImages/8P.png" alt="" />
            </template>
          </van-image>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    pics: Array
  }
}
</script>

<style lang="less" scoped>
.right-box {
  display: flex;
  flex-direction: column;
  img {
    height: 100%;
    width: 100%;
  }
  ::v-deep .van-image {
    height: 100%;
    width: 100%;
  }
  .top-box,
  .bottom-box {
    display: flex;
    justify-content: space-between;

    &.top-box {
      .pic-item {
        width: 33%;
        height: 118px;
        margin-bottom: 2px;
      }
    }

    &.bottom-box {
      .left-item {
        width: 66%;
        height: 238px;
      }

      .right-item {
        display: flex;
        flex-direction: column;
        width: 33%;

        .pic-item {
          height: 118px;
          width: 100%;
          margin-bottom: 2px;
        }
      }
    }
  }
}
</style>
